/************************************************************************/
/* GUI                                                                  */
/************************************************************************/
#include "GUI/Misc/Cursor.h"

namespace TD_GUI {

	/************************************************************************/
	/* Default definitions                                                  */
	/************************************************************************/

	SDL_Cursor *SDLCursor::m_pCursor = NULL;
	cursorTypes SDLCursor::m_currCursor = invalidCursor;
	
	const char *SDLCursor::hand[] = {
		"32 32 3 1",
		"X c #000000",
		". c #ffffff",
		"  c None", 
		"     XX                         ", 
		"    X..X                        ", 
		"    X..X                        ", 
		"    X..X                        ", 
		"    X..X                        ", 
		"    X..XXX                      ", 
		"    X..X..XXX                   ", 
		"    X..X..X..XX                 ", 
		"    X..X..X..X.X                ", 
		"XXX X..X..X..X..X               ", 
		"X..XX........X..X               ", 
		"X...X...........X               ", 
		" X..X...........X               ", 
		"  X.X...........X               ", 
		"  X.............X               ", 
		"   X............X               ", 
		"   X...........X                ", 
		"    X..........X                ", 
		"    X..........X                ", 
		"     X........X                 ", 
		"     X........X                 ", 
		"     XXXXXXXXXX                 ", 
		"                                ", 
		"                                ", 
		"                                ",
		"                                ", 
		"                                ", 
		"                                ", 
		"                                ", 
		"                                ", 
		"                                ",
		"                                ",
		"0,0"
	};

	const char *SDLCursor::arrow[] = {
		/* width height num_colors chars_per_pixel */
		"    32    32        3            1",
		/* colors */
		"X c #000000",
		". c #ffffff",
		"  c None",
		/* pixels */



		"X                               ",
		"XX                              ",
		"X.X                             ",
		"X..X                            ",
		"X...X                           ",
		"X....X                          ",
		"X.....X                         ",
		"X......X                        ",
		"X.......X                       ",
		"X........X                      ",
		"X.....XXXXX                     ",
		"X..X..X                         ",
		"X.X X..X                        ",
		"XX  X..X                        ",
		"X    X..X                       ",
		"     X..X                       ",
		"      X..X                      ",
		"      X..X                      ",
		"       XX                       ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"                                ",
		"0,0"
	};

	/* XPM */ 
	const char * SDLCursor::war3Orc[] = {
		"32 32 574 2",
		"  	c None",
		"! 	c white",
		"# 	c #858783",
		"$ 	c #4F564B",
		"% 	c #53594E",
		"& 	c #B0B1AF",
		"' 	c #404C39",
		"( 	c #69845F",
		") 	c #69835C",
		"* 	c #43523B",
		"+ 	c #B1B1B0",
		", 	c #3C4B35",
		"- 	c #607954",
		". 	c #657F59",
		"0 	c #47583F",
		"1 	c #64695F",
		"2 	c #A4A5A3",
		"3 	c #C4C5C4",
		"4 	c #3D4E32",
		"5 	c #708F63",
		"6 	c #799A6C",
		"7 	c #6B8A5D",
		"8 	c #425339",
		"9 	c #AAABA9",
		": 	c #5C6357",
		"; 	c #7B996F",
		"< 	c #93B487",
		"= 	c #79996C",
		"> 	c #57714B",
		"? 	c #33412C",
		"@ 	c #AAAAA9",
		"A 	c #B7B8B7",
		"B 	c #485841",
		"C 	c #89A77F",
		"D 	c #7D9C72",
		"E 	c #618055",
		"F 	c #4C6640",
		"G 	c #424D3C",
		"H 	c #F1F1F1",
		"I 	c #929590",
		"J 	c #70746D",
		"K 	c #E5E6E5",
		"L 	c #FEFEFE",
		"M 	c #777C74",
		"N 	c #6C8A60",
		"O 	c #84AB74",
		"P 	c #719D60",
		"Q 	c #5E844C",
		"R 	c #405834",
		"S 	c #565E52",
		"T 	c #979895",
		"U 	c #878A84",
		"V 	c #5B7452",
		"W 	c #648159",
		"X 	c #8A9186",
		"Y 	c #8B8D89",
		"Z 	c #90928E",
		"[ 	c #868984",
		"] 	c #858883",
		"^ 	c #8A8C88",
		"_ 	c #C3C4C2",
		"` 	c #F8F8F8",
		"a 	c #475F3D",
		"b 	c #8BB977",
		"c 	c #83B36E",
		"d 	c #6B9658",
		"e 	c #436536",
		"f 	c #2A3725",
		"g 	c #2C3B27",
		"h 	c #3B5331",
		"i 	c #54744A",
		"j 	c #607C55",
		"k 	c #58704E",
		"l 	c #4E6742",
		"m 	c #44593A",
		"n 	c #4C6443",
		"o 	c #4F6346",
		"p 	c #495A41",
		"q 	c #4A5244",
		"r 	c #7D807B",
		"s 	c #B6B7B5",
		"t 	c #F6F6F6",
		"u 	c #F5F5F5",
		"v 	c #566251",
		"w 	c #87B673",
		"x 	c #8AB975",
		"y 	c #6F955E",
		"z 	c #415D36",
		"{ 	c #2A3825",
		"| 	c #334728",
		"} 	c #476537",
		"~ 	c #507046",
		" !	c #5B7351",
		"!!	c #5D7A51",
		"#!	c #567646",
		"$!	c #557246",
		"%!	c #5C7A4F",
		"&!	c #557049",
		"'!	c #536A48",
		"(!	c #576C4D",
		")!	c #586A4F",
		"*!	c #4F5948",
		"+!	c #B7B8B5",
		",!	c #F7F7F7",
		"-!	c #72786E",
		".!	c #7AA767",
		"0!	c #84AD70",
		"1!	c #69875B",
		"2!	c #496140",
		"3!	c #415A37",
		"4!	c #476736",
		"5!	c #537841",
		"6!	c #668D58",
		"7!	c #6E9260",
		"8!	c #648A53",
		"9!	c #597F46",
		":!	c #5B7E48",
		";!	c #5D834C",
		"<!	c #527541",
		"=!	c #5B6F50",
		">!	c #526749",
		"?!	c #3F5236",
		"@!	c #787D73",
		"A!	c #EFEFEE",
		"B!	c #80857D",
		"C!	c #658855",
		"D!	c #749762",
		"E!	c #6D8960",
		"F!	c #6A8C5D",
		"G!	c #6B9159",
		"H!	c #60874D",
		"I!	c #5C834A",
		"J!	c #678E57",
		"K!	c #739966",
		"L!	c #759A66",
		"M!	c #688E55",
		"N!	c #5D7E4B",
		"O!	c #527640",
		"P!	c #4D743B",
		"Q!	c #557048",
		"R!	c #52654A",
		"S!	c #44573C",
		"T!	c #304428",
		"U!	c #7C8179",
		"V!	c #F0F0EF",
		"W!	c #8D908B",
		"X!	c #4E6B41",
		"Y!	c #749961",
		"Z!	c #87A976",
		"[!	c #8BB47A",
		"]!	c #7FA76C",
		"^!	c #689156",
		"_!	c #5E854E",
		"`!	c #678C59",
		"a!	c #81A373",
		"b!	c #88AA7D",
		"c!	c #709661",
		"d!	c #5E7E4E",
		"e!	c #50753E",
		"f!	c #4E743B",
		"g!	c #557545",
		"h!	c #516948",
		"i!	c #283921",
		"j!	c #82867F",
		"k!	c #F1F1F0",
		"l!	c #9C9D9A",
		"m!	c #4A623F",
		"n!	c #83AA72",
		"o!	c #98BC88",
		"p!	c #9FC78E",
		"q!	c #8CB57A",
		"r!	c #6A9558",
		"s!	c #5F8650",
		"t!	c #6D9360",
		"u!	c #87A97B",
		"v!	c #8EAE80",
		"w!	c #709261",
		"x!	c #547847",
		"y!	c #4B703B",
		"z!	c #4F733D",
		"{!	c #547643",
		"|!	c #4E6A42",
		"}!	c #3B5233",
		"~!	c #273820",
		" #	c #8C9089",
		"!#	c #F2F2F2",
		"##	c #A3A4A2",
		"$#	c #465B3E",
		"%#	c #85A876",
		"&#	c #91B881",
		"'#	c #9EC88C",
		"(#	c #96BF86",
		")#	c #77A166",
		"*#	c #698E58",
		"+#	c #739360",
		",#	c #83A676",
		"-#	c #8CAD7A",
		".#	c #709460",
		"0#	c #537644",
		"1#	c #496A3A",
		"2#	c #4F7140",
		"3#	c #567747",
		"4#	c #4D6941",
		"5#	c #395031",
		"6#	c #91968F",
		"7#	c #F3F3F3",
		"8#	c #A3A5A2",
		"9#	c #41543A",
		":#	c #78996A",
		";#	c #7DA76B",
		"<#	c #8CB679",
		"=#	c #99C187",
		">#	c #90B481",
		"?#	c #82A06F",
		"@#	c #718959",
		"A#	c #71935F",
		"B#	c #739A60",
		"C#	c #567D46",
		"D#	c #486B38",
		"E#	c #4F713F",
		"F#	c #5A794A",
		"G#	c #536F46",
		"H#	c #3D5434",
		"I#	c #263620",
		"J#	c #8C918A",
		"K#	c #CBCCCB",
		"L#	c #B3B5B2",
		"M#	c #B3B4B2",
		"N#	c #80857E",
		"O#	c #3B5033",
		"P#	c #6A8C5B",
		"Q#	c #739E5F",
		"R#	c #7EAA6A",
		"S#	c #92BA7F",
		"T#	c #9BBE89",
		"U#	c #89A777",
		"V#	c #678355",
		"W#	c #61854E",
		"X#	c #7BA16A",
		"Y#	c #769D63",
		"Z#	c #587F46",
		"[#	c #476C35",
		"]#	c #4E713C",
		"^#	c #577B48",
		"_#	c #4F6F42",
		"`#	c #39502F",
		"a#	c #24331E",
		"b#	c #8B908A",
		"c#	c #AFB0AD",
		"d#	c #A9AAA7",
		"e#	c #A9ABA8",
		"f#	c #AEB0AD",
		"g#	c #A7AAA6",
		"h#	c #9C9F9A",
		"i#	c #53644B",
		"j#	c #6A8260",
		"k#	c #627758",
		"l#	c #43543A",
		"m#	c #39502E",
		"n#	c #628853",
		"o#	c #77A963",
		"p#	c #7DAA69",
		"q#	c #8AB577",
		"r#	c #8CB378",
		"s#	c #7CA36D",
		"t#	c #698D5B",
		"u#	c #5C844C",
		"v#	c #719A5E",
		"w#	c #759F64",
		"x#	c #5D854A",
		"y#	c #4D703B",
		"z#	c #4D713B",
		"{#	c #517441",
		"|#	c #46633B",
		"}#	c #314727",
		"~#	c #213219",
		" $	c #8B9088",
		"!$	c #658059",
		"#$	c #6C8B5D",
		"$$	c #6D8E61",
		"%$	c #719063",
		"&$	c #79A069",
		"'$	c #8EB27C",
		"($	c #93B980",
		")$	c #8BB479",
		"*$	c #638355",
		"+$	c #3E5434",
		",$	c #405735",
		"-$	c #648556",
		".$	c #83B070",
		"0$	c #86B174",
		"1$	c #8AB377",
		"2$	c #80A86C",
		"3$	c #6D975F",
		"4$	c #628C51",
		"5$	c #699357",
		"6$	c #6B935B",
		"7$	c #5F874F",
		"8$	c #51783F",
		"9$	c #4C743D",
		":$	c #4A6B3C",
		";$	c #3D5532",
		"<$	c #2B3E22",
		"=$	c #1F2F18",
		">$	c #8B8F88",
		"?$	c #475443",
		"@$	c #5A714E",
		"A$	c #739563",
		"B$	c #6E8B5F",
		"C$	c #658357",
		"D$	c #729763",
		"E$	c #8CB17A",
		"F$	c #99C287",
		"G$	c #87B374",
		"H$	c #668D55",
		"I$	c #4F723F",
		"J$	c #4C713D",
		"K$	c #5D804E",
		"L$	c #759B64",
		"M$	c #86AC74",
		"N$	c #8CB37B",
		"O$	c #78A165",
		"P$	c #6B9757",
		"Q$	c #709E5C",
		"R$	c #719F5D",
		"S$	c #6E995B",
		"T$	c #668E54",
		"U$	c #60884F",
		"V$	c #587F47",
		"W$	c #517542",
		"X$	c #46613B",
		"Y$	c #354A2C",
		"Z$	c #24341C",
		"[$	c #747A70",
		"]$	c #ADAEAB",
		"^$	c #DFE1DE",
		"_$	c #717A6C",
		"`$	c #414F3B",
		"a$	c #3D4C34",
		"b$	c #31422B",
		"c$	c #3E5236",
		"d$	c #567548",
		"e$	c #688F56",
		"f$	c #6C9658",
		"g$	c #618A4E",
		"h$	c #527741",
		"i$	c #4A703B",
		"j$	c #59804A",
		"k$	c #759E63",
		"l$	c #80A86F",
		"m$	c #7FAB6D",
		"n$	c #6A9556",
		"o$	c #669851",
		"p$	c #72A35D",
		"q$	c #78A465",
		"r$	c #74A160",
		"s$	c #70975D",
		"t$	c #6E935D",
		"u$	c #698B5A",
		"v$	c #5D7851",
		"w$	c #2C3F22",
		"x$	c #1B2813",
		"y$	c #A8ABA6",
		"z$	c #EEEFEE",
		"{$	c #FDFDFD",
		"|$	c #EDEEED",
		"}$	c #9B9E98",
		"~$	c #A0A29F",
		" %	c #969993",
		"!%	c #7B8476",
		"#%	c #2E4421",
		"$%	c #405F30",
		"%%	c #4C6C3B",
		"&%	c #48663A",
		"'%	c #3E5B31",
		"(%	c #446336",
		")%	c #6B9859",
		"*%	c #6D9A58",
		"+%	c #669550",
		",%	c #6CA058",
		"-%	c #7BAB68",
		".%	c #7CA66A",
		"0%	c #7CA569",
		"1%	c #7FA16E",
		"2%	c #77976A",
		"3%	c #708A63",
		"4%	c #667E5A",
		"5%	c #4C6142",
		"6%	c #2C3F23",
		"7%	c #172410",
		"8%	c #AEB0AC",
		"9%	c #F4F4F4",
		":%	c #9EA29C",
		";%	c #7A8274",
		"<%	c #273A1F",
		"=%	c #2B3D23",
		">%	c #1D2C17",
		"?%	c #1D2B17",
		"@%	c #3E5834",
		"A%	c #4D7240",
		"B%	c #597E48",
		"C%	c #668F52",
		"D%	c #6D9A59",
		"E%	c #7DA46C",
		"F%	c #81A670",
		"G%	c #86A47A",
		"H%	c #6A8D5E",
		"I%	c #5F7C51",
		"J%	c #607854",
		"K%	c #596C4E",
		"L%	c #405138",
		"M%	c #21311B",
		"N%	c #A4A8A2",
		"O%	c #DFDFDF",
		"P%	c #FBFBFB",
		"Q%	c #B1B2B0",
		"R%	c #989B97",
		"S%	c #989B95",
		"T%	c #0B0E06",
		"U%	c #0B0F09",
		"V%	c #23311C",
		"W%	c #344A29",
		"X%	c #3C5731",
		"Y%	c #5D834A",
		"Z%	c #6C9259",
		"[%	c #77A064",
		"]%	c #8CAA7F",
		"^%	c #7C9374",
		"_%	c #5F7B53",
		"`%	c #526945",
		"a%	c #576845",
		"b%	c #5A5C46",
		"c%	c #4C4939",
		"d%	c #323823",
		"e%	c #2D3624",
		"f%	c #D2D2D1",
		"g%	c #FAFAFA",
		"h%	c #BBBBBA",
		"i%	c #B9BAB9",
		"j%	c #A6A7A6",
		"k%	c #7B8178",
		"l%	c #223518",
		"m%	c #223619",
		"n%	c #304926",
		"o%	c #466937",
		"p%	c #597F47",
		"q%	c #6B9157",
		"r%	c #86A278",
		"s%	c #6D835F",
		"t%	c #556641",
		"u%	c #4A492D",
		"v%	c #503A1F",
		"w%	c #592F1D",
		"x%	c #59281D",
		"y%	c #4C281C",
		"z%	c #33231A",
		"{%	c #2F2F25",
		"|%	c #787C73",
		"}%	c #CDCECD",
		"~%	c #EEEEEE",
		" &	c #B6B7B4",
		"!&	c #656D60",
		"#&	c #1B2A14",
		"$&	c #223718",
		"%&	c #344C29",
		"&&	c #4D713A",
		"'&	c #5D824A",
		"(&	c #738A5F",
		")&	c #636D43",
		"*&	c #5A4722",
		"+&	c #542514",
		",&	c #52150D",
		"-&	c #5B1613",
		".&	c #5D1E19",
		"0&	c #5F302B",
		"1&	c #502F2D",
		"2&	c #2B1C16",
		"3&	c #313328",
		"4&	c #80837D",
		"5&	c #F0F0F0",
		"6&	c #B8B9B6",
		"7&	c #676F63",
		"8&	c #1B2914",
		"9&	c #25381B",
		":&	c #3E5F2C",
		";&	c #4E6836",
		"<&	c #6E6738",
		"=&	c #714224",
		">&	c #6B2113",
		"?&	c #6A1C1B",
		"@&	c #5A1514",
		"A&	c #510E0D",
		"B&	c #511617",
		"C&	c #6E4647",
		"D&	c #705755",
		"E&	c #3E2A27",
		"F&	c #251914",
		"G&	c #7D7C78",
		"H&	c #C3C5C2",
		"I&	c #7C8078",
		"J&	c #273221",
		"K&	c #2C4122",
		"L&	c #564D1E",
		"M&	c #7F3920",
		"N&	c #862A1E",
		"O&	c #782421",
		"P&	c #7C3D3D",
		"Q&	c #633937",
		"R&	c #421E1C",
		"S&	c #3B1815",
		"T&	c #553E3A",
		"U&	c #5B514E",
		"V&	c #36302F",
		"W&	c #827D7C",
		"X&	c #9D9D9A",
		"Y&	c #D0D0CF",
		"Z&	c #A5A7A3",
		"[&	c #2F3A28",
		"]&	c #4E380F",
		"^&	c #802A19",
		"_&	c #7D2623",
		"`&	c #6D2F2E",
		"a&	c #705554",
		"b&	c #645451",
		"c&	c #412B28",
		"d&	c #25100E",
		"e&	c #201414",
		"f&	c #231E1E",
		"g&	c #1C1C19",
		"h&	c #959693",
		"i&	c #E0E0DF",
		"j&	c #E3E3E3",
		"k&	c #323F2A",
		"l&	c #3A2908",
		"m&	c #692813",
		"n&	c #64231E",
		"o&	c #512D2A",
		"p&	c #4A403B",
		"q&	c #3F3C3A",
		"r&	c #261C1B",
		"s&	c #120A0A",
		"t&	c #090608",
		"u&	c #060405",
		"v&	c #8F908E",
		"w&	c #A7A8A5",
		"x&	c #F4F4F3",
		"y&	c #EAEAEA",
		"z&	c #535E4D",
		"{&	c #232512",
		"|&	c #4D2717",
		"}&	c #29130D",
		"~&	c #211917",
		" '	c #1E1919",
		"!'	c #151517",
		"#'	c #0B0A0A",
		"$'	c #040303",
		"%'	c #9A9A9A",
		"&'	c #A4A4A4",
		"''	c #BFBFBE",
		"('	c #E4E5E4",
		")'	c #FCFCFC",
		"*'	c #F9F9F9",
		"+'	c #D1D4D0",
		",'	c #4F5849",
		"-'	c #454635",
		".'	c #585C50",
		"0'	c #949694",
		"1'	c #A6A5A5",
		"2'	c #A5A5A6",
		"3'	c #A3A4A4",
		"4'	c #A3A3A3",
		"5'	c #C4C4C3",
		"6'	c #EFEFEF",
		"7'	c black",
		"! ! ! ! ! ! # $ % & ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ",
		"! ! ! ! ! ! ' ( ) * + ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ",
		"! ! ! ! ! ! & , - . 0 1 2 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ",
		"! ! ! ! ! ! ! 3 4 5 6 7 8 9 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ",
		"! ! ! ! ! ! ! ! : ; < = > ? @ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ",
		"! ! ! ! ! ! ! ! A B C D E F G 9 ! H I J K L ! ! ! ! ! ! ! ! ! ! ",
		"! ! ! ! ! ! ! ! ! M N O P Q R S T U V W X Y Z [ ] ^ _ ` ! ! ! ! ",
		"! ! ! ! ! ! ! ! ! & a b c d e f g h i j k l m n o p q r s t ! ! ",
		"! ! ! ! ! ! ! ! ! u v w x y z { | } ~  !!!#!$!%!&!'!(!)!*!+!,!! ",
		"! ! ! ! ! ! ! ! ! ! -!.!0!1!2!3!4!5!6!7!8!9!:!;!<!&!=!>!?!@!A!! ",
		"! ! ! ! ! ! ! ! ! ! B!C!D!E!F!G!H!I!J!K!L!M!N!O!P!Q!R!S!T!U!V!! ",
		"! ! ! ! ! ! ! ! ! ! W!X!Y!Z![!]!^!_!`!a!b!c!d!e!f!g!h!?!i!j!k!! ",
		"! ! ! ! ! ! ! ! ! ! l!m!n!o!p!q!r!s!t!u!v!w!x!y!z!{!|!}!~! #!#! ",
		"! ! ! ! ! ! ! ! ! ! ##$#%#&#'#(#)#*#+#,#-#.#0#1#2#3#4#5#~!6#7#! ",
		"! ! ! ! ! ! ! ! ! ! 8#9#:#;#<#=#>#?#@#A#n!B#C#D#E#F#G#H#I#J#!#! ",
		"! ! ! ! ! ! ! K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#b#!#! ",
		"! c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#~# $!#! ",
		"M#!$#$$$%$&$'$($)$*$+$,$-$.$0$1$2$Q#3$4$5$6$7$8$9$:$;$<$=$>$!#! ",
		"?$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$]$u ! ",
		"^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$m w$x$y$z${$! ",
		"L |$L#}$~$ %!%#%$%%%&%'%(%;!)%*%+%,%-%.%0%1%2%3%4%5%6%7%8%,!! ! ",
		"! ! ,!9%u 7#s :%;%<%=%>%?%@%A%B%C%D%E%F%%#G%H%I%J%K%L%M%N%O%P%! ",
		"! ! ! ! ! ! t u Q%R%S%T%U%V%W%X%]#Y%Z%[%]%^%_%`%a%b%c%d%e% %f%g%",
		"! ! ! ! ! ! ! ! t 9%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%w%x%y%z%{%|%}%",
		"! ! ! ! ! ! ! ! ! ! ~%9%~% &!&#&$&%&&&'&(&)&*&+&,&-&.&0&1&2&3&4&",
		"! ! ! ! ! ! ! ! ! ! ! ! ! 5&6&7&8&9&:&;&<&=&>&?&@&A&B&C&D&E&F&G&",
		"! ! ! ! ! ! ! ! ! ! ! ! ! ! !#H&I&J&K&L&M&N&O&P&Q&R&S&T&U&V&W&X&",
		"! ! ! ! ! ! ! ! ! ! ! ! ! ! ! u Y&Z&[&]&^&_&`&a&b&c&d&e&f&g&h&i&",
		"! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ,!j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&",
		"! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! y&z&{&|&}&~& '!'#'$'%'&'''(')'",
		"! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! *'+','-'.'0'1'2'3'4'5'6'6')'! ",
		"                                                                "};



	/************************************************************************/
	/* Ctors and dtors                                                      */
	/************************************************************************/
	
	SDLCursor::SDLCursor() {
	
	}
	SDLCursor & SDLCursor::operator = (const SDLCursor &rhs) {
		return(*this);
	}

	SDLCursor::SDLCursor(const SDLCursor &rhs) {
		
	}
	
	SDLCursor::SDLCursor(cursorTypes cursorType) {
		setCursor(cursorType);
	}

	SDLCursor::~SDLCursor() {
		if(m_pCursor != NULL) {
			SDL_FreeCursor(m_pCursor);
		}
	}

	/************************************************************************/
	/* Private functions                                                    */
	/************************************************************************/

	SDL_Cursor* SDLCursor::createCursor(const char *image[]) {
		int i, row, col;
		Uint8 data[4*32];
		Uint8 mask[4*32];
		int hot_x, hot_y;

		i = -1;
		for ( row=0; row<32; ++row ) {
			for ( col=0; col<32; ++col ) {
				if ( col % 8 ) {
					data[i] <<= 1;
					mask[i] <<= 1;
				} else {
					++i;
					data[i] = mask[i] = 0;
				}
				switch (image[4+row][col]) {
		case 'X':
			data[i] |= 0x01;
			mask[i] |= 0x01;
			break;
		case '.':
			mask[i] |= 0x01;
			break;
		case ' ':
			break;
				}
			}
		}
		sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
		return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
	}


	/************************************************************************/
	/* Functionalities                                                      */
	/************************************************************************/
	void SDLCursor::setCursor(cursorTypes cursorType) {
		switch(cursorType) {
			case arrowCursor:
				if(cursorType != m_currCursor) {
					if(m_pCursor != NULL) {
						SDL_FreeCursor(m_pCursor);	
					}
					m_pCursor = createCursor(arrow);
					m_currCursor = cursorType;
				}
			break;

			case handCursor:
				if(cursorType != m_currCursor) {
					if(m_pCursor != NULL) {
						SDL_FreeCursor(m_pCursor);	
					}	
					m_pCursor = createCursor(hand);
					m_currCursor = cursorType;
				}
			break;
		}
		if(m_pCursor != NULL) {
			SDL_SetCursor(m_pCursor);
		}
	}

	void SDLCursor::hideCursor(bool hide) {
		if(hide)
			SDL_ShowCursor(SDL_DISABLE);
		else
			SDL_ShowCursor(SDL_ENABLE);
	}
	

}